package com.ecloud.service.security.feign.fallback;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import com.ecloud.common.base.result.Result;
import com.ecloud.common.base.result.Rows;
import com.ecloud.common.web.result.FallBackBuilder;
import com.ecloud.openapi.translate.dto.BaseTranslateInfoDto;
import com.ecloud.openapi.translate.vo.BaseTranslateInfoListVo;
import com.ecloud.service.security.feign.iface.BaseTranslateInfoFeign;

/**
 * 字典断路器工厂
 *
 * @author LiuGangQiang Create in 2021/08/14
 */
@Component
public class BaseTranslateInfoFallbackFactory implements FallbackFactory<BaseTranslateInfoFeign> {

    @Override
    public BaseTranslateInfoFeign create(Throwable cause) {
        return new BaseTranslateInfoFeign() {

            @Override
            public Result<Rows<BaseTranslateInfoListVo>> queryList(BaseTranslateInfoDto dto) {
                return FallBackBuilder.build(cause);
            }

        };
    }

}
